<template>
    <div class="wrapper">
      <detail-header></detail-header>
      <detail-banner :allData="allData"></detail-banner>
      <detail-list :categoryList="categoryList"></detail-list>
    </div>
</template>

<script>
  import DetailHeader from '@/pages/detail/components/header'
  import DetailBanner from '@/pages/detail/components/banner'
  import DetailList from '@/pages/detail/components/list'
  import axios from 'axios'
    export default {
        name: "detail",
        components:{
          DetailHeader,
          DetailBanner,
          DetailList
        },
      data(){
          return{
            categoryList:[],
            allData:{}

          }
      },
        methods:{
            getDetailInfo(){
              axios.get('static/moke/detail.json',{
                params:{
                  id:this.$route.params.id
                }
              }).then(this.getSucc)
              // console.log(this.$route.params.id);
            },
            getSucc(res){
              // console.log(res);
              let data=res.data;
              // console.log(data);
              if(data.ret && data.data){
                  this.categoryList=data.data.categoryList;
                  this.allData=data.data
              }

            }

        },
        mounted(){
            this.getDetailInfo();
        }
    }
</script>

<style lang="stylus" scoped>

</style>
